<script type="text/javascript">
$(function(){
	$.formValidator.initConfig({
	    formID:"admin_newslist_add_dialog_form",
	    onError:function(msg){
	        /*$.messager.alert('错误提示', msg, 'error');*/
	    },
	    onSuccess:adminnewslistAddDialogFormSubmit,
	    submitAfterAjaxPrompt:'有数据正在异步验证，请稍等...',
	    inIframe:true
	});
})
function adminnewslistAddDialogFormSubmit(){
	$.post('/admin/news/news_add', $("#admin_newslist_add_dialog_form").serialize(), function(res){
		if(res.code == 0){
		    $.messager.alert('提示信息', res.msg, 'info');
			$('#admin_newslist_add_dialog').dialog('close');
            adminNewsListRefresh();
		}else{
			$.messager.alert('提示信息', res.msg, 'error');
		}
	}, 'json')
}
</script>
<form id="admin_newslist_add_dialog_form">
{% raw xsrf_form_html() %}
<table cellspacing="6" width="100%">
	<tr>
		<td width="80">新闻标题：</td>
		<td><input id="admin_newslist_add_dialog_form_name" type="text" name="title" style="width:280px;height:22px" /></td>
		<td><div id="admin_newslist_add_dialog_form_nameTip"></div></td>
	</tr>
    <tr>
		<td>分类：</td>
		<td colspan="2">
            <select name="category_id">
                <option value="1">国内新闻</option>
                <option value="2">国际新闻</option>
            </select>
		</td>
	</tr>
	<tr>
		<td>新闻内容：</td>
		<td colspan="2"><textarea name="content" style="width:90%;height:500px;font-size:12px"></textarea></td>
	</tr>
	<tr>
		<td>发布状态：</td>
		<td colspan="2">
            <label><input type="radio" name="status" value="1"  />发布</label>
            <label><input type="radio" name="status" value="2"  />草稿</label>
        </td>
	</tr>
</table>
</form>